package com.xpgk.mvc.bcost;


import java.util.List;

import com.jfinal.aop.Before;
import com.jfinal.plugin.activerecord.tx.Tx;
import com.xpgk.mvc.base.BaseController;

public class BcostController extends  BaseController{
	
	private  BcostService bcostService;
	public  void  index()
	{	
		String  organids=getCUserOrganIds();
    	String  userids=getCUserIds();
    	setAttr("organids", organids);
		setAttr("userids", userids);
		render("Bcost.html");
	}
	
//	/**获取支出人员
//	 * 
//	 */
//	public  void  getUser()
//	{
//		String orgids=getCUserOrganIds();
//		String sql=getSqlMy(User.sqlId_organUserList);
//		List<User>  uList=User.dao.find(sql,orgids);
//		renderJson(uList);
//	}
	
	/**
	 * 保存费用支出
	 */
	@Before(Tx.class)
	public void  saveBcost()
	{
		List<SbPay> spList = getModels(SbPay.class);
		String orgids=getCUserOrganIds();
		String userids=getCUserIds();
		String msg=bcostService.saveBcost(userids,orgids,spList);
		renderText(msg);
		
		
	}
}
